#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QVariantMap>

namespace Ui {
    class MainWindow;
}

class QActionGroup;
class WidgetWithGdrData;
class QLabel;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void closeEvent(QCloseEvent *);

private:
    Ui::MainWindow *ui;
    QActionGroup* agBuildPoints;
    QActionGroup* agSkillPoints;
    QVariantMap gdrData;
    QLabel* lbCharName;
    QLabel* lbCharPointTxt1;
    QLabel* lbCharPointVal1;
    QLabel* lbCharPointTxt2;
    QLabel* lbCharPointVal2;

    // HELPERS
    bool parseGdrData(QString);

private slots:
    void on_actionEdit_Profession_triggered();
    void on_actionNew_Profession_triggered();
    void on_actionExport_PDF_Sheet_triggered();

    WidgetWithGdrData* newCharacter();
    void loadCharacterFromFile();
    void loadCharacterFromFile(QString);
    void saveCurrentCharacter();
    void saveCurrentCharacter(QString);
    void saveCurrentCharacterAs();
    bool saveGdrData(QString file);

    void onTabTitleChange(QString);
    void onTabClosing(int);
    void onTabChange(int);

    void showLocaleError(QString, QString);
    void showVersionError(QString, QString);

    void exportAsPdfSheet();
    void exportAsPdfSheet(QString);
    void onPdfSheetGenerated(int);

    void clearStatusBar();
    void updateStatusBar();
};

#endif // MAINWINDOW_H
